import 'package:flutter/material.dart';

class ContainerRoute extends StatefulWidget {
  const ContainerRoute({Key? key}) : super(key: key);

  @override
  _ContainerRouteState createState() => _ContainerRouteState();
}

class _ContainerRouteState extends State<ContainerRoute> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Title'),
      ),
      body: Container(
        margin: const EdgeInsets.only(top: 50, left: 120),//定义盒子左右间距
        constraints: const BoxConstraints.tightFor(width: 200, height: 150),//盒子大小
        decoration: const BoxDecoration( //用BoxDecoration定义渐变色
          gradient: RadialGradient(
            colors: [Colors.red, Colors.orange],//渐变颜色
            center: Alignment.bottomLeft,//渐变方向
            radius: .98,
          ),
          boxShadow: [
            BoxShadow(
                color: Colors.black54,
                offset: Offset(2.0, 4.0),
                blurRadius: 4.0)
          ],
        ),
        transform: Matrix4.rotationZ(.2),
        alignment: Alignment.center,
        child: const Text(
          "5.20",
          style: TextStyle(color: Colors.white, fontSize: 40.0),
        ),
      ),
    );
  }
}
